<style>
.fui-goods-item .image {
    height: 5.6rem;
    width: 10rem;
}
.fui-goods-group {
    padding:0.3rem
}
.timer {
    font-size: .6rem;
    height: .95rem;
    color: #ef4f4f;
}
.timer span {
    display: inline-block;
    background:#582e19;
    color:#fff;
    width:.9rem;height:.9rem;
    border-radius: .1rem;
    line-height:.9rem;
    font-size:.5rem; text-align: center;
}

</style>
	<div ng-if="!loading && pagedata.list.length>0" class="fui-goods-group no" style="background-color:#f7f7f7">
			<div ng-repeat="item in pagedata.list" style="background:#fff">
			<div class="fui-goods-item" style="padding:0;margin:0.3rem;border: 0px solid #e7e7e7;">
				<div ng-click="pagedata.gotoitem(item);" ng-if="!item.video || pagedata.shopset.no_video==1" ng-class="{'image':1, 'echelon':item.active.title}" data-text="{{item.active.title}}" style="background-image: url({{tomedia(item.image) ||'../core/resource/images/nopic.jpg'}})">
				</div>
				<div ng-if="item.video && pagedata.shopset.no_video !=1" class="image">
					<video style="width:100%;height:100%;background:#999" controls="" x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto"
						  poster="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}"
						  data-setup='{"controls": true, "autoplay": false}'>
						  <source ng-src="{{tomedia(item.video)}}" type="video/mp4">					 
					</video>
				</div>
				<div class="detail" style="height:2.6rem;padding-left:0.3rem;padding-top:0.2rem">
					<div ng-click="pagedata.gotoitem(item);" class="overflow-h" style="width:10rem">
							{{item.title}}
					</div>
					<div ng-if="!item.active.rest_time" class="subtitle overflow-h" style="width:10rem">
							{{item.subtitle || '暂时没有商品描述... ...'}}
					</div>
					<div ng-if="item.active.rest_time" class="timer" ng-init="tool.time_down(pagedata.list[$index].active.rest_time)" style="width:10rem">
							{{item.active.status==0?'距开始':'距结束'}}  <span class="time-hour">{{pagedata.list[$index].active.rest_time.hour}}</span>:<span class="time-min">{{pagedata.list[$index].active.rest_time.minute}}</span>:<span class="time-sec">{{pagedata.list[$index].active.rest_time.second}}</span>
					</div>
					<div>
						<span class="price green" style="margin-top:0.1rem;margin-right:0.3rem">￥ 
							<span ng-if="!item.active.price" style="font-weight:bold;font-size:0.8rem;">{{item.price}}</span>
							<span ng-if="item.active.price" style="font-weight:bold;font-size:0.8rem;">{{item.active.price}}</span> /{{item.unit || '份'}}
							<span ng-if="!pagedata.pluginset.noweight && item.weight>0" style="color:#999;font-size:0.55rem;font-weight:400">({{item.weight}}kg)</span>
							<span class="text" style="text-align:right;"><span class="subtitle" style="font-weight:400;padding-left:0.2rem;font-size:0.6rem">已售{{item.salenum || 0}}{{item.unit || '件'}}</span></span>
						</span>
						<div href="javascript:" ng-click="pagedata.addtocart(item)" class="jylabel jylabel-red active" style="padding:0.25rem 0.5rem;border-radius:1rem;font-weight:400">加入购物车</div>
					</div>
				</div>
			</div>
			<div ng-if="item.stores.length>0" class="fui-cellone" style="padding:0.2rem">
				<div class="fui-cellone-text">
					<span ng-repeat="(k,v) in item.stores" ng-if="$index<5" class="jylabels jylabel-f3f3f3" ng-click="pagedata.params.store_id=v.id;">{{v.title}}(余{{v.total || 0}}{{item.unit || '份'}})</span>
				</div>
				<div class="fui-cellone-remark" ng-click="pagedata.getstores(item)">
					更多
				</div>
			</div>
			</div>
	</div>
	<div ng-show="loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
	<div id="showtaobaoke"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
			<div class="modal-dialog" style="width:80%;left:10%;">
				<div class="wap-qrcode-container" style="border-radius:0.5rem;height:auto">
					<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
					<p class="example1" style="padding:0.3rem;border-radius:0.5rem;margin:1rem;background:#FFFFCC">{{pagedata.copyinfo}}</p>
					<p ng-click="clip(pagedata.copyinfo)" class="example1 btn btn-sm btn-red-o">复制商品口令</p>
				</div>
			</div>
	</div>
<div ng-if="pagedata.showstores" class="popup">
	<div class="popup-body">
		<div class="popup-bottom">
			<i class="closed icon icon-cuowu" ng-click="pagedata.showstores=false"></i>
			<div class="fui-page-title" style="margin-top:1rem">门店库存情况</div>
			<div class="fui-cellone" style="padding:0.2rem">
				<div class="fui-cellone-text">
					<span ng-repeat="(k,v) in pagedata.stores" class="jylabels jylabel-f3f3f3" ng-click="pagedata.params.store_id=v.id;">{{v.title}}(余{{v.total || 0}}{{item.unit || '份'}})</span>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
scope.pagedata.getstores=function(goods){
	scope.pagedata.showstores=true;
	scope.get('jy_shopwms/index/getstores/goodsid='+goods.id,function(res){
		scope.pagedata.stores=res.list
		scope.$evalAsync();
	});
}
scope.pagedata.addtocart=function(item){
	scope.post_json('jy_weishop/goods.detail/addtocart/',{'goodsid':item.id},function(){
		if(scope.main.menus && scope.main.menus.length>0){
			for(var i=0;i<scope.main.menus.length;i++){
				if(scope.main.menus[i].action=='jy_weishop/member.cart/'){
					scope.main.menus[i].nums++
				}
			}
		}
		scope.message('加入成功！');
		scope.$evalAsync();
	})
}
</script>